package io.renren.modules.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import io.renren.common.utils.R;
import io.renren.modules.sys.dao.SysBuildDao;
import io.renren.modules.sys.entity.SysBuildEntity;
import io.renren.modules.sys.service.SysBuildService;

@Service("sysBuildService")
public class SysBuildServiceImpl implements SysBuildService {
	@Autowired
	private SysBuildDao sysBuildDao;

	@Override
	public SysBuildEntity queryObject(Long buildId) {
		return sysBuildDao.queryObject(buildId);
	}

	@Override
	public List<SysBuildEntity> queryList(Map<String, Object> map) {
		return sysBuildDao.queryList(map);
	}

	@Override
	public int queryTotal(Map<String, Object> map) {
		return sysBuildDao.queryTotal(map);
	}

	@Override
	public void save(SysBuildEntity sysBuild) {
		sysBuild.setCreateTime(new Date());
		sysBuildDao.save(sysBuild);
	}

	@Override
	public void update(SysBuildEntity sysBuild) {
		sysBuildDao.update(sysBuild);
	}

	@Override
	public void delete(Long buildId) {
		sysBuildDao.delete(buildId);
	}

	@Override
	public void deleteBatch(Long[] buildIds) {
		sysBuildDao.deleteBatch(buildIds);
	}

	public R dropDownList() {
		return R.ok().put("dropDownList", sysBuildDao.dropDownList());
	}

}
